﻿ <%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="List.aspx.vb" Inherits="SingerProfile.AlbumList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 199px;
        }
        .style2
        {
            width: 4px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <br />
    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
    <ItemTemplate>
     <a href="AlbumsWithTags.aspx?TagName=<%#Eval("Tag")%>"><%# Eval("Tag")%></a>  |  
    </ItemTemplate>
    </asp:Repeater>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:SingerProfileConStr %>" 
        ProviderName="<%$ ConnectionStrings:SingerProfileConStr.ProviderName %>" 
        SelectCommand="SELECT [Tag] FROM [AlbumsWithTags]"></asp:SqlDataSource>
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" 
    DataSourceID="SingerProfileDataSource" AllowSorting="True" CellPadding="4" 
        EnableSortingAndPagingCallbacks="True" ForeColor="#333333" 
        GridLines="None" Width="100%" >
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    <Columns>
        <asp:ImageField DataImageUrlField="Cover_Picture" HeaderText="Album Cover">
            <ControlStyle CssClass="AlbumCover" />
        </asp:ImageField>
       <%--
            Refferences : All images taken from wikipedia 
                http://en.wikipedia.org/wiki/Robbie_Williams
                http://en.wikipedia.org/wiki/Life_thru_a_Lens    
       --%> 
        

        <asp:HyperLinkField DataNavigateUrlFields="ID" 
            DataNavigateUrlFormatString="Details.aspx?ID={0}" 
            DataTextField="Album_Name" HeaderText="Album Name" SortExpression="Album_Name"  />
        <asp:BoundField DataField="Release_year" HeaderText="Released in year" 
            SortExpression="Release_year" />
    </Columns>
        <EditRowStyle CssClass="_EditRowStyle"/>
        <FooterStyle CssClass = "_FooterStyle"/>
        <HeaderStyle CssClass="_HeaderStyle"/>
        <PagerStyle CssClass ="_PagerStyle"/>
        <RowStyle CssClass="_RowStyle"/>
        <SelectedRowStyle CssClass="_SelectedRowStyle"/>
        <SortedAscendingCellStyle CssClass="_SortedAscendingCellStyle"/>
        <SortedAscendingHeaderStyle CssClass="_SortedAscendingHeaderStyle"/>
        <SortedDescendingCellStyle CssClass="_SortedDescendingCellStyle"/>
        <SortedDescendingHeaderStyle CssClass="_SortedDescendingHeaderStyle"/>
</asp:GridView>
<asp:SqlDataSource ID="SingerProfileDataSource" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SingerProfileConStr %>" 
    ProviderName="<%$ ConnectionStrings:SingerProfileConStr.ProviderName %>" 
    
        SelectCommand="SELECT [Cover_Picture], [Album_Name], [Release_year], [ID] FROM [Albums]">
</asp:SqlDataSource>
    <br />
    * Please click on Album name for brief description of that particular album.
    <br />
    <fieldset>
    <legend>Add New Album</legend>

        <table align="left" style="width: 50%;">
            <tr>
                <td class="style1" valign="middle">
                    Album Title</td>
                <td class="style2">
                    &nbsp;</td>
                <td align="left" valign="middle">
                    <asp:TextBox ID="txt_add_alb_name" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1" valign="middle">
                    Release Year</td>
                <td class="style2">
                    &nbsp;</td>
                <td align="left" valign="middle">
                    <asp:TextBox ID="txt_add_release_year" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1" valign="middle">
                    Cover picture</td>
                <td class="style2">
                    &nbsp;</td>
                <td align="left" valign="middle">
                    <asp:FileUpload ID="Fup_add_Albpicture" runat="server" />
                </td>
            </tr>
            <tr>
                <td class="style1" valign="top">
                    Description</td>
                <td class="style2">
                    &nbsp;</td>
                <td align="left" valign="middle">
                    <asp:TextBox ID="txt_add_Alb_Desc" runat="server" Height="202px" Width="286px" 
                        TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1" valign="top">
                    &nbsp;</td>
                <td class="style2">
                    &nbsp;</td>
                <td align="left" valign="middle">
                    <asp:Button ID="btn_Add_Addalbum" runat="server" Text="Add" />
                </td>
            </tr>
        </table>

    </fieldset><br />
    <br />
    <br />
    <br />
</asp:Content>
